<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    function Hore (name, type, blood) {
      this.name = name;
      this.type = type;
      this.blood = blood;
      this.attack = function (gongji) {
        console.log(gongji);
      }
    }
    var lianpo = new Hore('廉颇', '力量型', '500血量');
    console.log(lianpo.name);
    console.log(lianpo.type);
    console.log(lianpo.blood);
    lianpo.attack('类型：近战');

    var houyi = new Hore('后裔', '射手型', '400血量');
    console.log(houyi.name);
    console.log(houyi.type);
    console.log(houyi.blood);
    houyi.attack('类型：远程');
  </script>
</head>

<body>

</body>

</html>